package shape;

public class Box extends Polyhedra {
	
	
	public static int DEFAULT_COLORS = -1;
	PolyhedraFace bo;
	PolyhedraFace to;
	PolyhedraFace le;
	PolyhedraFace ri;
	PolyhedraFace fr;
	PolyhedraFace ne;
	int color;

	public Box(float b, float t, float l, float r, float f, float n, int color) {
		this.color = color;
		if(color == DEFAULT_COLORS) {
			this.color = 0xFFCCFFAA;
		}
		
		if(color == DEFAULT_COLORS) {
			this.color = 0xAAFCFCFF;
		}
		bo = new PolyhedraFace(this.color);
		bo.addVertex(l, b, n);
		bo.addVertex(r, b, n);
		bo.addVertex(r, b, f);
		bo.addVertex(l, b, f);
		this.addFace(bo);
		
		ne = new PolyhedraFace(this.color);
		ne.addVertex(l, b, n);
		ne.addVertex(r, b, n);
		ne.addVertex(r, t, n);
		ne.addVertex(l, t, n);
		this.addFace(ne);
		
		
		if(color == DEFAULT_COLORS) {
			this.color = 0xAACFFFCF;
		}
		to = new PolyhedraFace(this.color);
		to.addVertex(l, t, n);
		to.addVertex(r, t, n);
		to.addVertex(r, t, f);
		to.addVertex(l, t, f);
		this.addFace(to);
		
		
		if(color == DEFAULT_COLORS) {
			this.color = 0xFFCCAAFF;
		}
		fr = new PolyhedraFace(this.color);
		fr.addVertex(l, b, f);
		fr.addVertex(r, b, f);
		fr.addVertex(r, t, f);
		fr.addVertex(l, t, f);
		this.addFace(fr);
		
		if(color == DEFAULT_COLORS) {
			this.color = 0xAAFFCCFF;
		}
		ri = new PolyhedraFace(this.color);
		ri.addVertex(r, b, n);
		ri.addVertex(r, t, n);
		ri.addVertex(r, t, f);
		ri.addVertex(r, b, f);
		this.addFace(ri);
		
		if(color == DEFAULT_COLORS) {
			this.color = 0xFFAACCFF;
		}
		le = new PolyhedraFace(this.color);
		le.addVertex(l, b, n);
		le.addVertex(l, t, n);
		le.addVertex(l, t, f);
		le.addVertex(l, b, f);
		this.addFace(le);
		

		
	
		
		
	}
	
	
	public void setColor(int color) {
		this.color = color;		
	}
	
	

}
